-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Use Web Cache API for extra layer of resources caching #5379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Web Cache API for extra layer of resources caching #5379
Conversation
cc: @terrakok when you are back :) I'd like to include this into 1.10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of the new ResourceReader's method I'd like to have next:
- CvrWebCache - implementation of the web cache specifically for CVR files
- in the web ResourceReader.readPart function implementation to add a logic: if the path is ended with
.cvr
then to use cached values
WDYT?
import org.w3c.workers.Cache | ||
|
||
/** | ||
* We use [Cache] and [org.w3c.dom.WindowSessionStorage] APIs to cache the successful strings.cvr responses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use it specifically for Strings.CVR then let's rename it to StringsWebCache. Otherwise, we mustn't mention cvr in the kdoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it's called ResourceWebCache
. It's applied for all requests which go through web resource reader (in readAsBlob
).
Might be worth to use it for all resource types |
Hi any progress? Would be nice to have for all resource types btw! |
7086016
to
c2dbca8
Compare
Ready for a new review. |
Use Web Cache API for all resources
The Cache is reset on every app launch (page refresh).
The initial idea was to reset the Cache only when a new session starts, but we risk to have an outdated resources state (it can be incompatible with the app logic expectations and lead to crashes).
Fixes https://youtrack.jetbrains.com/issue/CMP-7996
Testing
This should be tested by QA
Release Notes
Fixes - Resources